//
// Created by mgr on 2019/1/3.
//

#include <UIlib.h>
#include <clicore.h>

#ifndef YDTMONOCLIENT_CRUISBASEWINDOW_H
#define YDTMONOCLIENT_CRUISBASEWINDOW_H

namespace cliMain {
    using namespace std;
    using namespace DuiLib;
    using namespace cliCore;

    class CRuisBaseWindow : public CWindowWnd, public INotifyUI {
    public:
        CRuisBaseWindow(LPCTSTR name,LPCTSTR skinfile);

        ~CRuisBaseWindow();

    public:
        virtual void Init() {}; // 界面控件一些初始化、比如某个按钮最开始是禁用状态就应该在这个时候处理…
        virtual void InitWindow(); // 界面控件加载完毕初始化…

        // WM_CREATE消息的处理
        virtual LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        // WM_NCHITTEST消息的处理
        virtual LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
        virtual LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);

        //////////////////////////////////////////////////////////////////////////
        // 继承自CWindowWnd类
    public:
        virtual void OnFinalMessage(HWND /*hWnd*/); // 窗口接收到最后一条消息的处理
        virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam); // 消息响应函数

        //////////////////////////////////////////////////////////////////////////

        // 继承自INotifyUI接口
    public:
        virtual void Notify(TNotifyUI &msg);

    public:
        LPCTSTR GetWindowClassName() const;
        virtual UINT GetClassStyle() const;

        CDuiString GetSkinFolder();
        CDuiString GetSkinFile();

        //////////////////////////////////////////////////////////////////////////

        // 成员变量
        //////////////////////////////////////////////////////////////////////////
    private:
        CDuiString mName;
        CDuiString skinFile;
        CButtonUI *m_pBtnOK; // 按钮控件
        CButtonUI *m_pBtnCancel;// 按钮控件

    protected:
        CPaintManagerUI m_PaintManager; // 窗口绘制器
    };
}

#endif //YDTMONOCLIENT_CRUISBASEWINDOW_H
